export default {
	data(){
		return {
			personTypeCfg:{
				1: '成人票',
				2: '儿童票',
				3: '免票儿童',
				4: '老人票'
			},
			personCardCfg: this.$uct.typeToText,
		}
	},
	onShow(){
		let pages = getCurrentPages();
		let curPage = pages[pages.length-1];
		let route = '/'+curPage.route;
		let options = curPage.options;
		if(JSON.stringify(options)!='{}'){
			let i = 0;
			for (let o in options) {
				route+=(i==0?'?':'&')+o+'='+options[o];
				i++;
			}
		}
		this.$path = route;
		if(this.$options&&this.$options.method&&this.$options.methods.toGetPassengers) this.toGetPassengers();
	},
	/* 用户点击右上角分享 */
	onShareAppMessage: function () {
		let title = '让海岛旅游更轻松！'
		let pages = getCurrentPages();
		let currentPage = pages[pages.length - 1];
		// 获取页面data数据
		let currentData = currentPage.data;
		if(currentPage.route=='pagesTrip/hotel/details/index'){
			title = currentData.myList.name
		}
		else if(currentPage.route=='pagesTrip/fishJiale2/goodDetail'){
			title = currentData.object.goodsName
		}
		else if(currentPage.route=='pagesTrip/fineFood/details/details'){
			title = currentData.detailsList.name
		}else{
			title =  currentPage.data.pageTitle
		}
		
		// if(currentPage.route=='steamerTicket/index'){
		// 	title = ''
		// }
		
		
		// 输出当前页面的data
		return {
			title: title,
			path: this.$path
		}
	},
	/* 分享到朋友圈 */
	onShareTimeline: function () {
		let title = '让海岛旅游更轻松！'
		let pages = getCurrentPages();
		let currentPage = pages[pages.length - 1];
		  
		// 获取页面data数据
		let currentData = currentPage.data;
		if(currentPage.route=='pagesTrip/hotel/details/index'){
			title = currentData.myList.name
		}
		if(currentPage.route=='pagesTrip/fishJiale2/goodDetail'){
			title = currentData.object.goodsName
		}
		if(currentPage.route=='pagesTrip/fineFood/details/details'){
			title = currentData.detailsList.name
		}
		return {
			title: title,
			path: this.$path
		}
	}
}